<?php
require_once('../inc/functions.php');
$section = 'Users';
?>
<!DOCTYPE html>

<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>N02243545</title>
    <link rel="stylesheet" type="text/css" href="../css/reset.css">
    <link rel="stylesheet" type="text/css" href="../css/style.css">
  </head>

  <body>
<?php
include('../inc/nav.php');
include('../inc/header.php');
?>
    <div id="content">
    <br />
      <table class="standard">
        <thead>
          <tr>
            <th>Name</th>
            <th colspan="3">Actions</th>
          </tr>
        </thead>
        <tbody>
<?php
$users = getTable('users');
while($row = $users->fetch_assoc()):
    $name = $row['first_name'].' ';
    if($row['middle_initial'] != NULL)
        $name .= $row['middle_initial'].'. ';
    $name .= $row['last_name'];
?>
          <tr>
            <td><?php echo $name; ?></td>
            <td><a href="">Edit</a></td>
            <td><a href="">Delete</a></td>
            <td><a href="details.php?id=<?php echo $row['id'];?>">View</a></td>
          </tr>
<?php endwhile; ?>
        </tbody>
        <tfoot>
          <tr>
            <td><a href="">Add new user</a></td>
          </tr>
        </tfoot>
      </table>
      <br />
    </div><!-- #content -->
<?php include('../inc/footer.php'); ?>
  </body>
</html>
